import os.path
from downloader import downloader

class feedprocessor:
	def __init__(self, config, feed):
		self.config = config
		self.feed = feed
		self.downloaded = []

	def get_url(self, url):
		basedir = os.path.expanduser(self.config["basedir"])			
		dp = os.path.join(basedir, self.feed.feedname) 
		return downloader().download(url, dp)

	def process(self):
		for url in self.feed.enclosures():
			of = self.get_url(url)
			if of != "":
				self.downloaded.append((url, of))
